package src.billing.subsystem;



import java.util.*;

public class Bill {

    private ArrayList<String> list;

    public Bill() {
    }

    public Bill(String input) {
        String[] inputMessages = input.split("\\|");
        list = new ArrayList<String>(Arrays.asList(inputMessages));

        for(int i = 0; i < list.size(); i++)
        {
            if(list.get(i).length() == 0)
            {
                list.remove(i);
            }
        }
    }

    public String getQueryName() {
        return list.get(0);
    }

    public String getParamN(int n) {
        return list.get(n);
    }

    public int getParamLength() {
        return list.size();
    }

}
